/*
 * @Author: cmd
 * @we_chat: cmd_develop
 * @Date: 2018-12-24 22:01:15
 * @LastEditors: cmd
 * @LastEditTime: 2019-03-20 22:45:22
 * @Description: 组件管理器
 * 
 */

const {ccclass, property} = cc._decorator;

import win_package from '../win_scripts/win_package';

@ccclass
export default class orc_alert{
    public static _alert_tips = false;
    public static _alert_loading = false;

    /**
     * 
     * @param win_name 窗口名字     
     */
    public static win_open(win_name:string,param:any = false){  
        cc.find("Canvas/win_manager").getChildByName(win_name).getComponent(win_name).win_param = param; 
        cc.find("Canvas/win_manager").getChildByName(win_name).active = true;
    }

    /**
     * 
     * @param win_name 窗口名字
     * @param close_type 窗口以何种模式关闭
     */
    public static win_close(win_name:string){   
        cc.find("Canvas/win_manager").getChildByName(win_name).active = false;     
        // let temp_node = cc.director.getScene().getChildByName(win_name); 
        // if (temp_node === null) { 
        //     //console.log('窗口名字不存在')
        // } 
        // else 
        // {   
        //     temp_node.active = false;
        // }
    }
}
